//index.js
//获取应用实例
const app = getApp()
import {request} from "../../request/request";

Page({
  data: {
    lunboList:[],
    cateList:[],
    indexList:[],
    isShow: false
  },
  onLoad: function () {
    this.getLunboList()
    this.getCateList()
    this.getIndexList()
  },
  onShow: function () {
  },
  onReachBottom:function(){
    this.setData({isShow:true})
  },
  async getLunboList(){
    await request({
      url:"/home/swiperdata"
    }).then(res=>{
      this.setData({lunboList:res.data.message})
    })
  },
  async getCateList(){
    const res= await request({url:"/home/catitems"})
    this.setData({cateList:res.data.message})
  },
  async getIndexList(){
    const res= await request({url:"/home/floordata"})
    this.setData({indexList:res.data.message})
  },
  searchInputFocus(e){
    wx.navigateTo({
      url:"/pages/search/search"
    })
  }
})
